<?php
/**
 * Created by PhpStorm.
 * User: u
 * Date: 2019/5/9
 * Time: 17:08
 */

namespace app\controllers;

use common\logics\myinvitate\MyInviteLogic;
use Yii;

class MyInvitateController extends BaseController
{
    /** @var \common\logics\myinvitate\MyInviteLogic $MyInvitateService **/
    private $MyInvitateService;

    public function init()
    {
        $this->MyInvitateService = Yii::$container->get("MyInvitateService");
        return parent::init(); // TODO: Change the autogenerated stub
    }
    //邀请商家
    public function actionMyInvitateList()
    {
        $param = [
            "type" => Yii::$app->request->post('type',1),               //类型  1.邀请商家  2.邀请买手
            "buy_id" => Yii::$app->request->post("buy_id",0),           //买手id
            "safetyCode" => Yii::$app->request->post("safetyCode",''),  //安全码
        ];
        $result = $this->MyInvitateService->getList($param);
        return $result;
    }
    //收徒奖励
    public function actionApprentAward()
    {
        $param = [
            "buy_id" => Yii::$app->request->post("buy_id",0),           //买手id
            "safetyCode" => Yii::$app->request->post("safetyCode",""),  //安全码
            "page_num" => Yii::$app->request->post("page_num",1),       //当前页数
            "limit" => Yii::$app->request->post("limit",10),            //每页条数
        ];
        $result = $this->MyInvitateService->getApprent($param);
        return $result;
    }
    //任务奖励查询
    public function actionTaskAward()
    {
        $param = [
            "buy_id" => Yii::$app->request->post("buy_id",0),           //买手id
            "safetyCode" => Yii::$app->request->post("safetyCode",""),  //安全码
            "page_num" => Yii::$app->request->post("page_num",1),       //当前页数
            "limit" => Yii::$app->request->post("limit",10),            //每页条数
        ];
        $result = $this->MyInvitateService->getTaskReward($param);
        return $result;
    }

}